package action;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;

import entity.User;

public class DataAction extends ActionSupport {
	private int age;
	private String name;
	private User user;
	private List<User> users;
	
	
	public int getAge() {
		return age;
	}

	public String getData(){
		name = "梅西";
		age = 25;
		user = new User(1, "admin", "123");
		users = new ArrayList<User>();
		users.add(new User(2, "jordan", "213"));
		users.add(new User(3, "科比", "333"));
		return SUCCESS;
	}

	public String getName() {
		return name;
	}

	/**
	 * 获取 user
	 * @return user 
	 */
	public User getUser() {
		return user;
	}

	/**
	 * 获取 users
	 * @return users 
	 */
	public List<User> getUsers() {
		return users;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * 设置 user 
	 * @param user user
	 */
	public void setUser(User user) {
		this.user = user;
	}
	/**
	 * 设置 users 
	 * @param users users
	 */
	public void setUsers(List<User> users) {
		this.users = users;
	}
}
